﻿using Acme.BookStore.FormWhxDto.BinlocationDto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace Acme.BookStore.FormWhxDto.StorehouseDto
{
    public interface IStorehouseService:ICrudAppService<StorehouseDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateStorehouseDto>
    {
        /// <summary>
        /// 获取所有库管部门（树形结构）
        /// </summary>
        Task<List<ManagementDeptDto>> GetManagementDeptTreeAsync();

        /// <summary>
        /// 根据父ID获取子部门
        /// </summary>
        Task<List<ManagementDeptDto>> GetManagementDeptChildrenAsync(int parentId);

        /// <summary>
        /// 搜索库管部门
        /// </summary>
        Task<PagedResultDto<ManagementDeptDto>> SearchManagementDeptAsync(ManagementDeptSearchDto input);

        /// <summary>
        /// 获取仓库主管列表
        /// </summary>
        Task<ListResultDto<WarehouseManagerDto>> GetWarehouseManagerAsync();

        /// <summary>
        /// 搜索仓库主管
        /// </summary>
        /// <param name="keyword">搜索关键字</param>
        Task<ListResultDto<WarehouseManagerDto>> SearchWarehouseManagerAsync(string keyword);

        /// <summary>
        /// 高级查询仓库信息
        /// </summary>
        /// <param name="input">查询条件</param>
        /// <returns>分页结果</returns>
        Task<PagedResultDto<StorehouseDto>> SearchAsync(StorehouseSearchDto input);

        /// <summary>
        /// 批量添加仓库及库位
        /// </summary>
        Task AddSorehouseWithLocations(CreateUpdateStorehouseWithLocationsDto input);

        /// <summary>
        /// 更新仓库状态
        /// </summary>
        /// <param name="input">包含仓库ID和新状态的DTO</param>
        /// <returns>更新后的仓库信息</returns>
        Task<StorehouseDto> UpdateStatusAsync(UpdateStorehouseStatusDto input);

        /// <summary>
        /// 批量删除仓库及其关联的库位
        /// </summary>
        /// <param name="ids">要删除的仓库ID列表</param>
        /// <returns>删除结果，包含成功和失败的信息</returns>
        Task<BatchDeleteResultDto> BatchDeleteAsync(List<Guid> ids);

        /// <summary>
        /// 更新仓库及其库位信息
        /// </summary>
        /// <param name="input">更新的仓库和库位信息</param>
        /// <returns>更新后的仓库信息</returns>
        Task<StorehouseDto> UpdateWithLocationsAsync(UpdateStorehouseWithLocationsDto input);

        /// <summary>
        /// 获取仓库及其库位的详细信息
        /// </summary>
        /// <param name="id">仓库ID</param>
        /// <returns>包含仓库信息和库位列表的DTO</returns>
        Task<StorehouseWithLocationsDto> GetStorehouseWithLocationsAsync(Guid id);
    }
}
